package com.augurit.wf.app.notice.event;

import java.util.List;

import org.jbpm.api.ExecutionService;
import org.jbpm.api.RepositoryService;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;
import org.jbpm.api.model.Activity;
import org.jbpm.api.model.Transition;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;

public class StateListener implements EventListener{
	private static final long serialVersionUID = 1L;
	  
	  
	public void notify(EventListenerExecution execution) {
		  ExecutionService executionService =  EnvironmentImpl.getCurrent().get(ExecutionService.class);
		  
		  System.out.println("--------------->timer测试 ");
		  String processInstanceId = execution.getProcessInstance().getId();
		  String oldProcInstId = (String)execution.getVariable("$SYS_PROCINST_ID");
		  if(oldProcInstId != null && oldProcInstId.equals(processInstanceId)){
			  System.out.println("------------->"+oldProcInstId);
			 // executionService.signalExecutionById(execution.getId());
		  }
	  }
}
